<?php

namespace App\Http\Controllers\Home;

use App\Http\Controllers\Controller;

use App\Http\Models\Nav;
use App\Http\Models\Category;

class CommonController extends Controller{
    public function __construct() {
        $navs = Nav::all();
        $allcate = Category::all();
//            
//        $hot = Article::orderBy('art_views', 'desc')->take(5)->get();
//        // new 8
//        $new = Article::orderBy('art_createtime', 'desc')->take(8)->get();
//        // links all
//        $link = Link::all();
//        
//        \View::share(['navs' => $navs]);
//        \View::share(['hot' => $hot]);
//        \View::share(['new' => $new]);
//        return \View::share(['link' => $link]);
                 \View::share(['allcate' => $allcate]);
          return \View::share(['navs' => $navs]);
    }
}
